Draws text in world space, scaled, turned and slanted: everything draw_text_warped does, plus two more numbers that slant the whole line the way italic writing slants. xshear slides the top of the letters sideways (a positive number leans them right) and yshear lifts one end of the line (a positive number lifts the right end). (x, y) is the same LEFT/CENTER/RIGHT anchor draw_text already uses, and the point the line is scaled, turned and slanted around, so the line stays where you put it. Inside a Draw GUI event it is fixed to the screen instead, and (x, y) counts from the screen’s top-left pixel.
Works differently on Game Boy - The Game Boy cannot lean letters one by one: with an xshear a text on the screen leans in 4 steps of 2 lines (Draw GUI events only); otherwise the line is turned and lifted by yshear in 8-pixel steps. The size is not used.
Works differently on Game Boy Color - The Game Boy Color cannot lean letters one by one: with an xshear a text on the screen leans in 4 steps of 2 lines (Draw GUI events only); otherwise the line is turned and lifted by yshear in 8-pixel steps. The size is not used.
Sega Genesis: not available
On other consoles this differs: see Side by side and How the consoles differ.
draw_text_sheared(x, y, text, xscale, yscale, angle, xshear, yshear)| Name | Type |
|---|---|
x | real |
y | real |
text | string |
xscale | real |
yscale | real |
angle | real |
xshear | real |
yshear | real |
Nothing.
Everything draw_text_warped does, plus a slant: xshear slides the top of the letters sideways and yshear lifts one end of the line. It is how italic writing slants, and it takes the same two numbers as draw_sprite_sheared and the xshear and yshear variables, so they mean the same thing here:
xshear is how many pixels the letters slide sideways for every pixel they are above or below their middle. At 0.5, the top edge of a letter that is 8 pixels tall (4 pixels above its middle) is 2 pixels to the right of where it would be, and its bottom edge is 2 pixels to the left, so it leans right. A negative number leans it left.yshear is how many pixels the letters slide up for every pixel of width. At 0.25 the right end of a word 40 pixels wide is 5 pixels higher than its middle, and its left end is 5 pixels lower. A negative number lifts the left end instead.The first six arguments are exactly draw_text_warped's, in the same order, so a call that already scales or turns text only needs two more numbers on the end. One call can scale, turn and slant a line at once, so there is no second name for text that does all three. (A line that is curved away from you as well as slanted is draw_text_3d_sheared.)
(x, y) is a place in the room, counted from the room's top-left corner. It is the same text_align-resolved spot draw_text uses, and it is also the point the line is scaled, turned and slanted around. The line stays where you put it: slanting a word does not slide it along the ground.


Left: draw_text, for comparison. Middle: the first example below, a lean to the right. Right: the second example, the right end lifted. The page's examples put the word above the object and the picture puts all three on one row, so they can be compared. Real pictures from a Game Boy Advance ROM, cropped and shown three times as big.


The bottom word's xshear going -0.80, -0.74 ... 0 ... 0.80 and back (the number under the picture is the one in use). The top word is plain and never changes. Sixteen real pictures, two frames apart, played at half the speed of the console. A viewer that does not animate shows the first frame.
Like every draw_ call, it only draws the frames it is called on, so call it every frame the word should stay on screen. Calling it with the same numbers every frame is cheap. Changing a number on every frame (an xshear that swings, say) builds the letters again on every frame, just as a changing scale does for draw_text_warped.
A note on 12. Twelve is how many sprites one drawn thing can use in every game that has not changed Sprites in one drawn thing under Engine limits in Project Settings (it goes up to 32). Wherever this page says 12 letters, it means that number.
Every letter of a word of 12 letters or fewer is a sprite of its own, and the Game Boy Advance draws a slanted or scaled sprite only inside a box twice as wide and twice as tall as the sprite. A letter is 8 by 8 pixels, so its box is 16 by 16. Anything that slides outside the box is cut off, and nothing can make the box bigger. So how much a word can lean depends on how big it is:
xshear of up to 1 is whole. Measured on a real console, a word leaned by 0.25, 0.5, 0.75 or 1 kept every one of its pixels. A lean of 1.5 kept 94% of them and a lean of 2 kept 88%, because the top and bottom of each letter slide past the edge of its box.yshear that lifts the ends of a long word far from its middle cuts off the letters at the ends: a word of sixteen letters kept every pixel at a yshear of 0.25 but only 88% at 0.5. The letters of a shared sprite can also come out slightly different from one another. Split a long line over two calls.The slant is exact while angle is 0. If the word is turned as well it is still slanted, but the slant is added to the turned picture, not to the screen's rows and columns, so it no longer lines up with them.
draw_text_sheared(x, y - 24, "SLANT", 1, 1, 0, 0.5, 0);A label reading SLANT, 24 pixels above this instance, at its normal size and not turned, leaning to the right like italic writing.
draw_text_sheared(x, y - 24, "SLANT", 1, 1, 0, 0, 0.25);The same word with its right end lifted, so it climbs to the right.
draw_text_sheared(x, y - 24, "SLANT", 1.5, 1.5, angle, 0.25, 0);All three at once: 50% bigger than normal, turned to match this instance's own angle, and leaning a little to the right. angle here is this instance's own variable, not the word's.
Costs ONE shared affine matrix for the whole line, exactly what draw_text_warped costs: the slant is two more numbers in that same matrix, so it takes no extra matrix and no row-by-row effect. A line that is scaled, turned or slanted and has 12 letters or fewer (or the number set under Engine limits in Project Settings, up to 32; spaces do not count) gets a sprite of its own for every letter, so every letter is changed in exactly the same way; that costs 12 of the 128 sprites the screen can show, where plain text costs 3. A longer line is still drawn, but its letters share sprites, up to four to a sprite, so they can come out a little uneven; a development build says so once in the log, and drawing a long line as two calls keeps it even. A scale of 1, no turn and no slant is plain draw_text: no matrix at all. The slant is exact while angle is 0; with a turn as well it is still there, but no longer lines up with the screen’s rows and columns. The console draws each letter inside a box twice its size, so a letter that is big and slanted a lot loses its sides: at a scale of 1 a slant up to 1 fits, and the bigger the scale the less slant fits (see the page). If every one of the hardware’s 32 affine matrices is already in use elsewhere, the text still draws, just upright for that frame.